<template>
  <div class="survey container-content">
    <el-row :gutter="20">
      <el-col :span="24">
        <h3 class="panel-title">成本调整单</h3>
      </el-col>
    </el-row>
    <el-divider class="divider"></el-divider>
    <el-row :gutter="20" class="mt20">
      <el-col :span="24">
        <!-- <el-row class="export-container">
                    <el-button type="primary" @click="addNewData"
                        >新增</el-button
                    >
                    <el-button type="primary" @click="exporting"
                        >导出</el-button
                    >
                </el-row> -->
        <!-- <el-row class="filter-container">
          <el-form ref="form" :model="form" label-width="80px">
            <el-form-item label="仓库名称">
              <el-select v-model="form.region" placeholder="请选择仓库">
                <el-option
                  v-for="(item,index) in options"
                  :key="index"
                  :label="item.wareName"
                  :value="item.wareCode"
                >
                </el-option>
              </el-select>
              <el-button type="primary" @click="getData"
                >提取库存物资</el-button
              >
              <el-button type="primary" @click="downlod">生成盘点单</el-button>
            </el-form-item>
          </el-form>
        </el-row> -->
        <el-table
          ref="customerTable"
          :data="tableData"
          stripe
          style="width: 100%"
         
        >
          <!-- @selection-change="handleSelectionChange" -->
          <el-table-column type="selection" width="55" align="center">
          </el-table-column>
          <el-table-column type="index" width="50"> </el-table-column>
          <el-table-column
            prop="docNo"
            label="单据编号"
          ></el-table-column>
          <el-table-column
            prop="docTypeCode"
            label="单据类型"
          ></el-table-column>
          <!-- <el-table-column prop="typeName" label="业务类型"></el-table-column> -->
          <el-table-column prop="materialCode" label="物料编码"> </el-table-column>
          <el-table-column prop="materialName" label="物料名称">
          </el-table-column>
          <el-table-column prop="brand" label="规格型号"></el-table-column>
          <el-table-column label="调整金额" prop="adjustmentAmount">
            
          </el-table-column>
          <el-table-column prop="adjustmentReason" label="调整原因">
          </el-table-column>
          <!-- <el-table-column prop="lossNum" label="仓库">
          </el-table-column> -->
          <el-table-column prop="bizTime" label="业务日期">
          </el-table-column>
          <!-- <el-table-column prop="purchasePrice" label="批号">
          </el-table-column> -->
          <!-- 
                    <el-table-column label="操作" width="200">
                        <template slot-scope="scope">
                            <el-tooltip
                                class="item"
                                effect="dark"
                                content="详情"
                                placement="bottom"
                            >
                                <el-button
                                    plain
                                    icon="el-icon-more"
                                    size="small"
                                    @click="
                                        handleDetail(scope.$index, scope.row)
                                    "
                                ></el-button>
                            </el-tooltip>
                            <el-tooltip
                                class="item"
                                effect="dark"
                                content="编辑"
                                placement="bottom"
                            >
                                <el-button
                                    type="primary"
                                    plain
                                    size="small"
                                    icon="el-icon-edit"
                                    @click="handleEdit(scope.$index, scope.row)"
                                ></el-button>
                            </el-tooltip>
                            <el-tooltip
                                class="item"
                                effect="dark"
                                content="删除"
                                placement="bottom"
                            >
                                <el-button
                                    type="danger"
                                    plain
                                    size="small"
                                    icon="el-icon-delete"
                                    @click="
                                        handleDelete(scope.$index, scope.row)
                                    "
                                ></el-button>
                            </el-tooltip>
                        </template>
                    </el-table-column> -->
        </el-table>
        <el-pagination
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
          class="table-pagination"
          background
          layout="total, sizes, prev, pager, next, jumper"
          :total="total"
          :page-size="limit"
          :current-page="page"
          :page-sizes="[10, 20, 30, 40, 50, 100]"
        >
        </el-pagination>
      </el-col>
    </el-row>
  </div>
</template>
<script>
import {
  getKingCostAdjustmentList,
} from "@/api/bim/bim";
export default {
  data() {
    return {
      options: [],
      
        
        total: 0,
        limit: 10,
        page: 1,

      searchValue: "",
      total: 0,
      pageSize: 0,
      currentPage: 0,
      treeData: [],
      defaultProps: {
        children: "treeList",
        label: "typeName",
      },
      tableData: [],
      tableDataList: [],
    };
  },
  methods: {
    // 获取列表
    getData() {
      getKingCostAdjustmentList({
        limit:this.limit,
        page:this.page
      }).then((res) => {
        if (res.code == 200) {
          this.tableData = res.data.records;
          this.form.total = res.data.total
        }
      });
    },
    // 分页
    handleSizeChange(val) {
      this.form.limit = val;
      this.getData();
    },
    handleCurrentChange(val) {
      this.form.page = val;
      this.getData();
    },
  },
  created() {
    this.getData();
  },
};
</script>
<style lang="scss" scoped>
.divider {
  margin: 0;
}
.export-container {
  margin: 15px 0;
}
.pagination {
  margin-top: 10px;
}
</style>
